
//动态路由核心-把后端树状结构转成列表结构
export function fn(data){
   let arr=[]
   function deep(data){
     data.forEach(item => {
         if(item.children.length){
            deep(item.children)
         }else{
            arr.push({
                  path: "/" + item.path,
                  name: item.authName,
                  component: () =>
                      import (`@/views/index/${item.path}.vue`)
                      // component: (resolve) => require([`@/views/${item.path}.vue`], resolve)
            })
         }
     });
   }
   deep(data)
   return arr
}